﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;


namespace MyXMLPrase
{
    public partial class SearchTreeByKey : Form
    {
        public SearchTreeByKey()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (valueBox.Text == "")
            {
                MessageBox.Show("搜索内容不能为空","提示");
                return;
            }
            String value = valueBox.Text;
            SearchTreeView stv = new SearchTreeView();
            try
            {
                this.Visible = false;
                //这里,出问题了.为什么我不能搜索treeview1的节点呢???参数传不进去.
                //估计是因为这个是一个类, 然后类里面不能有具体的数据值.
                stv.FindNode(null, value);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
    }
}
